import store from '@/service/store/index'
import ala from 'ala'

export function vuexSet (name, value) {
  store.state[name] = value
}
export function vuexGet (name) {
  return store.state[name]
}
export function vuexLocalGet (name, encrypt = false) {
  var data = vuexGet(name)
  if (data) {
    return data
  } else {
    data = ala.localGet(name, encrypt)
    vuexSet(name, data)
    return data
  }
}

export function vuexRemove (name) {
  store.state[name] = null
}

export function vuexLocalSet (name, value, encrypt = false) {
  vuexSet(name, value)
  ala.localSet(name, value, encrypt)
}


export function vuexLocalRemove (name) {
  vuexRemove(name)
  ala.localRemove(name)
}